﻿using System;
using System.Collections;
using System.Diagnostics;
using System.ServiceProcess;
using System.Threading;
using System.Windows.Forms;

namespace YB_Server_Windows
{
    internal static class Program
    {
        [STAThread]
        static void Main()
        {
            using (Mutex mutex = new Mutex(true, "Global\\YbServers", out bool createdNew))
            {
                if (!createdNew)
                {
                    Console.WriteLine("程序已经启动，不需要再次启动");
                    return;
                }

                // 执行其他代码


                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //form = new main();
                Application.Run(new main());
            }

            //YB.Log.Write("启动服务");
            //ServiceBase[] ServicesToRun;
            //ServicesToRun = new ServiceBase[]
            //{
            //    new JXServer()
            //};
            //ServiceBase.Run(ServicesToRun);
        }
    }

}